log("状态机加载成功");
Unit = {};
Unit.State = {};
Unit.Param = {};
RunState = async (State, StateTab, StateParam) => {
  if (State[StateTab] != null) {
    return State[StateTab](StateParam);
  };
  return "Error";
};
run = async () => {
  Unit.State.Name = "合成";
  while (true) {
    await sleep(1000);
    Unit.State.Name = await RunState(Unit.State, Unit.State.Name, Unit.Param[Unit.State.Name]);
  };
};
Unit.State.Stop = async () => {
  bd.log("停止脚本");
  plus.webview.currentWebview().reload(true);
  return "Stop";
};
